home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
docs
/
asm_guide
/
examples
/
binaryconv.s
next >
Wrap
Text File
|
1991-10-24
|
540b
|
26 lines
;************************
;* A little example *
;************************
; Enter the debugger and AddWatch on the BUFFER of String type.
; Press Arrow Down to single step the program. To enter the
; subroutine press Arrow Left.
; The hexvalue $1231 in D0 will slowly be converted into the
; binary number %1001000110001
J: MOVE.L #$1231,D0
LEA.L BUFFER(PC),A0
.AGAIN: MOVE.L D0,-(A7)
LSR.L #1,D0
BEQ.S .FINI
BSR.S .AGAIN
.FINI: MOVE.L (A7)+,D0
AND.W #1,D0
MOVEQ #'0',D1
ADD.W D0,D1
MOVE.B D1,(A0)+
RTS
BUFFER: DCB.B 100,0